package top.wardyan.wmes.rfid.vo;

import top.wardyan.wmes.constant.ControlType;
import top.wardyan.wmes.constant.KeyStatus;
import top.wardyan.wmes.constant.Template;

/**
 * RFID接口的参数
 * @author harrydeep@wardyan.top
 * 2021年10月15日
 */
public class Command {
		
	
	/** 模板号 **/
	Template template = Template.LINE;
	/** 是否清空屏幕显示 **/
	Boolean clearDisplay = true;
	
	/** 显示行数, 不包括提示栏 **/
	Integer lineQty = 0;
	
	/** 是否发送控制指令 **/
	Boolean sendCtrlCmds = true;
	
	/** 键盘锁定:128不锁数字键 **/
	Integer lockKeyPosition = 128;
	
	/** 128单键 129多键 **/
	KeyStatus keyStatus = KeyStatus.SINGLE;

	/** 控制指令 注意有些型号的工位机不支持控制指令，发给它也会被忽略掉，但不会报错 **/ 
	/** LED灯1 **/
	ControlType led1 = ControlType.NONE;
	ControlType led2 = ControlType.NONE;
	ControlType led3 = ControlType.NONE;
	ControlType relay1 = ControlType.NONE;
	ControlType relay2 = ControlType.NONE;
	ControlType relay3 = ControlType.NONE;
	
	/** 发声次数 默认1次 **/
	Integer soundQty = 1;
	
	/** 发声间隔, 单位毫秒 **/
	Integer soundIntv = 200;
	
	/** 显示指令 **/
	Line line1;
	Line line2;
	Line line3;
	Line line4;
	Line line5;
	Line line6;
	Line line7;
	Line line8;
	Line line9;
	Line line10;
	Line lineDesc;
	
	public Command() {}
	
	
	
	public Command setLine(Integer index,Line line) {
		if(index != null && index > 0 && index < 12) {
			switch(index) {
			case 1 :
				this.setLine1(line);
				break;
			case 2 :
				this.setLine2(line);
				break;
			case 3 :
				this.setLine3(line);
				break;
			case 4 :
				this.setLine4(line);
				break;
			case 5 :
				this.setLine5(line);
				break;
			case 6 :
				this.setLine6(line);
				break;
			case 7 :
				this.setLine7(line);
				break;
			case 8 :
				this.setLine8(line);
				break;
			case 9 :
				this.setLine9(line);
				break;
			case 10 :
				this.setLine10(line);
				break;
			case 11 :
				this.setLineDesc(line);
				break;
			}
		}
		return this;
	}
	
	
	public Template getTemplate() {
		return template;
	}
	public Command setTemplate(Template template) {
		this.template = template;
		return this;
	}
	public Boolean getClearDisplay() {
		return clearDisplay;
	}
	public Command setClearDisplay(Boolean clearDisplay) {
		this.clearDisplay = clearDisplay;
		return this;
	}
	public Integer getLineQty() {
		return lineQty;
	}
	public Command setLineQty(Integer lineQty) {
		this.lineQty = lineQty;
		return this;
	}
	
	public Integer getSoundQty() {
		return soundQty;
	}
	public Command setSoundQty(Integer soundQty) {
		this.soundQty = soundQty;
		return this;
	}
	public Integer getSoundIntv() {
		return soundIntv;
	}
	public Command setSoundIntv(Integer soundIntv) {
		this.soundIntv = soundIntv;
		return this;
	}
	public Line getLine1() {
		return line1;
	}
	public Command setLine1(Line line1) {
		this.line1 = line1;
		return this;
	}
	public Line getLine2() {
		return line2;
	}
	public Command setLine2(Line line2) {
		this.line2 = line2;
		return this;
	}
	public Line getLine3() {
		return line3;
	}
	public Command setLine3(Line line3) {
		this.line3 = line3;
		return this;
	}
	public Line getLine4() {
		return line4;
	}
	public Command setLine4(Line line4) {
		this.line4 = line4;
		return this;
	}
	public Line getLine5() {
		return line5;
	}
	public Command setLine5(Line line5) {
		this.line5 = line5;
		return this;
	}
	public Line getLine6() {
		return line6;
	}
	public Command setLine6(Line line6) {
		this.line6 = line6;
		return this;
	}
	public Line getLine7() {
		return line7;
	}
	public Command setLine7(Line line7) {
		this.line7 = line7;
		return this;
	}
	public Line getLine8() {
		return line8;
	}
	public Command setLine8(Line line8) {
		this.line8 = line8;
		return this;
	}
	public Line getLine9() {
		return line9;
	}
	public Command setLine9(Line line9) {
		this.line9 = line9;
		return this;
	}
	public Line getLine10() {
		return line10;
	}
	public Command setLine10(Line line10) {
		this.line10 = line10;
		return this;
	}
	public Line getLineDesc() {
		return lineDesc;
	}
	public Command setLineDesc(Line lineDesc) {
		this.lineDesc = lineDesc;
		return this;
	}
	public ControlType getLed1() {
		return led1;
	}
	public ControlType getLed2() {
		return led2;
	}
	public ControlType getLed3() {
		return led3;
	}
	public ControlType getRelay1() {
		return relay1;
	}
	public ControlType getRelay2() {
		return relay2;
	}
	public ControlType getRelay3() {
		return relay3;
	}
	public Command setLed1(ControlType led1) {
		this.led1 = led1;
		return this;
	}
	public Command setLed2(ControlType led2) {
		this.led2 = led2;
		return this;
	}
	public Command setLed3(ControlType led3) {
		this.led3 = led3;
		return this;
	}
	public Command setRelay1(ControlType relay1) {
		this.relay1 = relay1;
		return this;
	}
	public Command setRelay2(ControlType relay2) {
		this.relay2 = relay2;
		return this;
	}
	public Command setRelay3(ControlType relay3) {
		this.relay3 = relay3;
		return this;
	}



	public Boolean getSendCtrlCmds() {
		return sendCtrlCmds;
	}



	public Integer getLockKeyPosition() {
		return lockKeyPosition;
	}



	public KeyStatus getKeyStatus() {
		return keyStatus;
	}



	public Command setSendCtrlCmds(Boolean sendCtrlCmds) {
		this.sendCtrlCmds = sendCtrlCmds;
		return this;
	}



	public Command setLockKeyPosition(Integer lockKeyPosition) {
		this.lockKeyPosition = lockKeyPosition;
		return this;
	}



	public Command setKeyStatus(KeyStatus keyStatus) {
		this.keyStatus = keyStatus;
		return this;
	}
	
	
	
	
	
	
}
